#pragma once

#include <Common/Common.h>
#include <Framework/FrameServer.h>
#include "WebSocketClientEvent.h"

class CWebSocketFrameServer : public CFrameServer
{
public:
    CWebSocketFrameServer(CEventEngine *pListenEngine);
    virtual ~CWebSocketFrameServer();

public:
    Bool Start(const CSocketAddr &address, const std::vector<CEventEngine *> &vecAsyncIo, CThreadPool *pWorkPool, IWebSocketHandlerFactory *pFactory);

protected:
    virtual CClientEvent* CreateClientEvent(Int32 nClientFD, const CSocketAddr &addr, CEventEngine *pEngine, IMessageDispatcher *pDispatcher);

protected:
    IWebSocketHandlerFactory*     m_pFactory;
};
